<?php

use yii\helpers\Html;
use yii\grid\GridView;

$this->title = Yii::t('app', 'Product Serves');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="product-serve-index">
 
    <div class="box">
        <div class="box-header">
            <?= Html::a(Yii::t('app', 'Create Product Serve'), ['create','product_id'=>$product_id], ['class' => 'btn btn-success']) ?>
        </div>
        <div class="box-body">
            <p>
                 <!-- </?php echo $this->render('_search', ['model' => $searchModel]); ?> -->
            </p>

            <?= GridView::widget([
                'dataProvider' => $dataProvider,
                'layout'  =>  "{items}\n{summary}\n{pager}",
                'columns' => [
                    ['class' => 'yii\grid\SerialColumn'],

                    'product.code',
                    'product.name',
                    'begin_date',
                    'end_date',
                    [
                      'attribute' => 'city',
                      'value' => function($model){

                            return $model->cityInfo;
                      }
                    ],
                    [
                          'attribute' => 'member_id',
                          'value' => function($model){

                                return $model->memberInfo;
                          }
                    ],
                    [
                      'attribute' => 'user_id',
                      'value' => function($model){

                            return $model->userName;
                      }
                    ],

                    [
                        'class' => 'yii\grid\ActionColumn',
                        'header' => '操 作',
                        'template' =>"{view} {update}"
                    ],
                ],
            ]); ?>
      </div>
    </div>

</div>
